package com.yqb.study.common.warpper.log;

import com.yqb.study.common.exception.GlobalException;
import com.yqb.study.constant.CodeMsgEnum;

/**
 * 创建包裹日志的类
 */
public class LogWarpperMapFactory {

	/**
	 * 通过类名创建具体的日志包裹类
	 */
	public static BaseLogWarpperMap createLogWarpperMap(Class<BaseLogWarpperMap> dictClazz) {
		try {
			Class<BaseLogWarpperMap> clazz = (Class<BaseLogWarpperMap>) Class.forName(dictClazz.getName());
			return clazz.newInstance();
		} catch (Exception e) {
			throw new GlobalException(CodeMsgEnum.LOG_WARPPER_FAIL);
		}
	}
}
